odoo.define("vnsoft.search.panel", function (require) {
    "use strict";

    const SearchPanel = require("web/static/src/js/views/search_panel.js");
    
    SearchPanel.patch("vnsoft.search.panel",T => class extends T {
        constructor() {
            super(...arguments);
            this.hasSplitBar = false;
        }
        mounted() {
            super.mounted();
            if(!this.hasSplitBar){
                let search_split = $("<div></div>").css({"width":"8px","height":"100%","border-width":"0 1px","display": "flex", "align-items": "center","background":"linear-gradient(to left,rgb(177 226 253), rgb(211 236 250), rgb(151 214 249))"});
                search_split.bind("click",this.toggle_split).insertAfter($(this.el))
                this.hasSplitBar = true;
            }
        }
        toggle_split(e) {
            let search_panel = $(e.target.parentNode).find(".o_search_panel");
            let display_val = search_panel.css("display")
            search_panel.css("display",display_val === "block" ? "none" : "block");
        }
    });

    return SearchPanel;
})